package org.example;

import org.example.service.ClientConnectServerThread;
import org.example.utils.Tools;
import org.example.utils.Utility;

import java.io.*;
import java.net.Socket;

/**
 *
 *
 */
public class ClientServer
{

    public ClientServer() throws IOException {
        Socket socket = new Socket("127.0.0.1",8088);
        ClientConnectServerThread clientConnectServerThread = new ClientConnectServerThread(socket);
        clientConnectServerThread.start();
        while (true) {
            OutputStream outputStream = socket.getOutputStream();
            System.out.println("请输入你想说的话");
            Tools.writeMessage(Utility.readString(50), outputStream);
        }


    }
    public static void main( String[] args ) throws IOException, ClassNotFoundException {
        ClientServer clientServer = new ClientServer();

    }
}
